﻿using System;
using System.Collections.Generic;
using System.Text;

namespace _017_字段_属性_索引器_常量_2_
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Student stu = new Student(1);
            stu.Id = 100;
            Console.WriteLine(stu.Id);
        }
    }

    public class Student
    {
        public readonly int Id;
        public int Age;

        public Student(int id)
        {
            //字段初始化  但后续不能修改
            this.Id = id;
        }
    }

    struct Color
    {

        public int Red;
        public int Green;
        public int Blue;
    }
}
